#ifndef MU_OBJECT_H
#define MU_OBJECT_H

#include <string>

#include "big_integer.h"
#include "big_decimal.h"

enum ObjectType {
  INTEGER,
  DECIMAL,
  BOOL,
  BYTE,
  STRING,
  OBJECT
};

struct Object {
  ObjectType type;
  union {
    int integer_val;
    double decimal_val;
    bool bool_val;
    char byte_val;
    std::wstring *string_val;
    void *object_val;
  } value;

  Object() {};

  Object(int val) : type(INTEGER) { value.integer_val = val; }

  Object(double val) : type(DECIMAL) { value.decimal_val = val; }

  Object(bool val) : type(BOOL) { value.bool_val = val; }

  Object(char val) : type(BYTE) { value.byte_val = val; }

  Object(const std::wstring &val) : type(STRING) { value.string_val = new std::wstring(val); }

  Object(void *val) : type(OBJECT) { value.object_val = val; }
};

#endif //MU_OBJECT_H
